Program: Ti-Go
Version: 1.4
By: Ben Axelrod

   This program allows you to play the ancient oriental game of Go on
your Ti-Calc against another player.  Due to screen limitations, only
a 9x9 game can be played.  This game is only in its first stages.  If
you are interested in helping me add some features, plaese contact me.

-------------------------------------------------------------------
HOW TO PLAY:

   First, load the program and pic3 to your calculator.  After starting
the program, select from the following menu:
1. Start game (to start a new even game)
2. Handicap (to start a new game with a handicap for black)
3. Load board (to resume a previously saved game)
4. Exit (exits the program)

   If a handicap game was selected, Black now has the opportunity to 
place as many handicap stones as you want.  Place the stones as usual.
Press the [PASS] button to initiate normal game play.

   Once at the playing screen, you can use the arrow keys in the upper
right of the calculator to move the square cursor around the board.  
The numerical keypad will also jump the cursor to the hoshi locations
on the board.  Notice that the coordinates of the cursor's location
are displayed in the upper right of the screen.  (This program follows
the standard coordinate naming conventions so the 8th column that
would be labeled "I" is named is actually named "J".)  

These are the functions of the buttons when on the playing screen:

Button   Name         Description 
-------+------+---------------------------------
Y=     - EXIT - Exits your game and the program
WINDOW - SAVE - Saves your game
ZOOM   - PASS - Passes your turn (also ends handicap mode)
TRACE  - KILL - Removes the dead stones of the last turn
GRAPH  - DROP - Places a stone on the board
ENTER  - DROP - Places a stone on the board
  1           - move cursor to lower left hoshi
  2           - move cursor to lower middle hoshi
  3           - move cursor to lower right hoshi
  4           - move cursor to middle left hoshi
  5           - move cursor to tengen
  6           - move cursor to middle right hoshi
  7           - move cursor to upper left hoshi
  8           - move cursor to upper middle hoshi
  9           - move cursor to upper right hoshi
Left Arrow    - move cursor one square left
Right Arrow   - move cursor one square right
Up Arrow      - move cursor one square up
Down Arrow    - move cursor one square down

   Game play proceeds as usual.  With black and white alternating.  
Notice that the color of the player's turn is displayed in the upper
right of the screen.  For speed's sake, the dead stone algorithm is
now a menu option.  After you place your stone, if there are stones
that need to be removed, press the [KILL] button.  This will scan the
last stone placed to determine if there are any dead stones.  Pressing
the [KILL] button when there are no stones to remove will not have any
affect.  The number of dead stones will be displayed on the screen.  
For example: If black surrounds and captures 2 white stones, there will
be a 2 next to the "B:" where the captured stones are displayed.
Unfortunatly, there is no undo feature yet.  So if you forget to press
the [KILL] button, you cannot go back!

   Note: This program does not check for illegal moves.  Illegal moves
include placing a stone where it has no liberties and kills no stones,
and Ko rules.

   At this time, only one game can be saved at a time.  The program
uses the list named "GO" to save your game.  If you delete this list,
your game will be lost.  

   A pass will just change the color of the player.  Two passes will not
end the game.  When your game is over, you must count the score yourself.

-------------------------------------------------------------------


What this program can do:
  * Use the arrow keys to more cursor around board
  * Use the number keys to move cursor to hoshi points
  * Allows a handicap for black
  * Removes dead stones upon request
  * Tracks the cursor position
  * Counts the dead stones for each player
  * Save 1 game at a time
  * Load the saved game
  * Displays who's turn it is
  * Allows a player to pass
  * Records the position of the last stone placed

Possible features to come in the future:
  * Calculator linking
  * Faster operation (assembly language)
  * Marking the last stone placed
  * Allow an undo
  * Check for "illegal" moves
  * Auto scoring
  * Put in Hoshi markers
  * Record game feature (see TI-Go-View for the TI-89)
  * Set handicap by placing stones on board (skips step of typing in number)
  * Ability to name the saved game so you can save more than one at a time
  * Add a comment field in the saved game
  * Allow 13 x 13 board size

   I would greatly appreciate some help with the rest of the program.
Specifically, adding calculator linking capabilities and converting
it to assembly.  If you are interested, please contact me at:
ben@micro-micr.com.  I can provide more documentation if you need.


-------------------------------------------------------------------
VERSION HISTORY:

Version 1.4:
   "Jump" keys 1-9 added
   Re-arranged menu buttons for easier one hand play
   Slight optimization in DSA
   Fully commented program
   Last stone position recorded

Version 1.2:
   Game load and save options added.

Version 1.1:
   Optimized code.  Included Pic3 in the zip.

Version 1.0:
   Initial release.


-------------------------------------------------------------------
Info on the program:
See dsa.txt for more info on the dead stone algorithm (DSA)

Global Variables:
  Matrix [G] = the board and stones, 
	   0 = empty
	   1 = black stone
	   2 = white stone
	   3 = board edge

  Matrix [H] = list of dead stones

  String 3 = "ABCDEFGHJ" for location display

  Pic 3 = screen background

  X,Y = current position of cursor
	in pixels, relative to a defined origin in the lower left
	corner of the board.  every 6 pixels = 1 square

  A,B = last position of cursor
	same units as X and Y

  T = whoes turn it is
  	1 = black
	2 = white

  O = number of stones black has captured

  P = number of stones white has captured

  H = number of handicap stones left

  K = GetKey variable

  R,S = Last stone placed
        same units as X and Y
 
Temp variables in specific subroutines: 

  M,N = used in game save subroutine (to iterate though the board)
      = used in game load subroutine (to iterate though the board)
      = used in DSA (M is delta Y, N is delta X of stone in list)
      = (similar to variables D and E)

  F = used in DSA (to iterate around the placed stone)

  J = used in DSA (to indicate if stone was already on list)
    = (1 = not on list, 0 = on list already)
    = used to iterate through list when erasing stones
    = used as a temp variable when incrementing M,N and D,E

  G = used in DSA (to iterate through the stones in the list)

  L = used in DSA (number of stones in list)

  D,E = used in DSA (D is delta Y, E is delta X of placed stone)
      = example, if D=0 and E=-1, then (X+E,Y+D) refers to the
      = position to the left of X,Y

  Z = used in DSA (to iterate around stones in list)

  I = used in DSA (to iterate through the stones in list)
    = (when checking if stone is already on the list)

------------------------------------------------------------------
GO LINKS:

http://www.usgo.org/
http://senseis.xmp.net/
http://kgs.kiseido.com/
http://senseis.xmp.net/?TiGo  <- the page for this program
